import 'package:flutter/material.dart';

class KeyTest1 extends StatefulWidget {
  @override
  _KeyTest1State createState() => _KeyTest1State();
}

class _KeyTest1State extends State<KeyTest1>
    with SingleTickerProviderStateMixin {
  AnimationController _controller;

  @override
  void initState() {
    super.initState();
    _controller = AnimationController(vsync: this);
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(title: Text('keytest1')),
        body: Scrollbar(
          // 显示进度条
          child: SingleChildScrollView(
              // 最简单的scrollview
              child: Column(
            children: [
              Container(
                color: Colors.green,
                margin: const EdgeInsets.all(8),
                child: ListView.builder(
                    physics: NeverScrollableScrollPhysics(),
                    shrinkWrap: true,
                    itemCount: 3,
                    itemBuilder: (BuildContext ccontext, int index) {
                      return LayoutBuilder(builder:
                          (BuildContext context, BoxConstraints constraints) {
                        print('$constraints + $index');
                        return Padding(
                          padding: const EdgeInsets.fromLTRB(15, 8, 15, 8),
                          child: Row(
                            crossAxisAlignment: CrossAxisAlignment.center,
                            children: [
                              DecoratedBox(
                                child: Image.network(
                                  'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201403%2F02%2F092241w9f4vaz8peovfe91.jpg&refer=http%3A%2F%2Fattach.bbs.miui.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1617171292&t=b841f99b45f0beae202712d143ff6101',
                                  width: 60,
                                  height: 60,
                                  // fit: BoxFit.fill,
                                ),
                                decoration: BoxDecoration(
                                  border: Border.all(
                                      color: Color(0xFF999999), width: 0.5),
                                  borderRadius: BorderRadius.circular((6.0)),
                                  // borderRadius:
                                  //     BorderRadius.vertical(top: Radius.elliptical(20, 50)),
                                ),
                              ),
                              const SizedBox(width: 10),
                              Expanded(
                                child: Column(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  children: [
                                    Row(children: [
                                      Expanded(
                                        child: Row(
                                          children: [
                                            Flexible(
                                              child: Text(
                                                '园林股份' * 10,
                                                // textScaleFactor: 0.8,
                                                maxLines: 1,
                                                overflow: TextOverflow.ellipsis,
                                                style: Theme.of(context)
                                                    .textTheme
                                                    .subtitle1,
                                              ),
                                            ),
                                            Container(
                                              margin: const EdgeInsets.fromLTRB(
                                                  5, 1, 10, 1),
                                              padding:
                                                  const EdgeInsets.fromLTRB(
                                                      2, 1, 2, 1),
                                              child: Text('传统行业'),
                                              decoration: BoxDecoration(
                                                color: Color(0xffebebeb),

                                                borderRadius:
                                                    BorderRadius.circular(
                                                        (6.0)),
                                                // borderRadius:
                                                //     BorderRadius.vertical(top: Radius.elliptical(20, 50)),
                                              ),
                                            ),
                                          ],
                                        ),
                                      ),
                                      Text('03-03')
                                    ]),
                                    Padding(
                                      padding: const EdgeInsets.only(
                                          top: 8.0, bottom: 8.0),
                                      child: Text('园林绿化综合性企业' * 3,
                                          style: TextStyle(
                                              fontSize: 14,
                                              color: Color(0xff666666))),
                                    ),
                                    Text('IPO,金融未披露,投资方未披露' * 3,
                                        style: Theme.of(context)
                                            .textTheme
                                            .subtitle2)
                                  ],
                                ),
                              )
                            ],
                          ),
                        );
                      });
                    }),
              ),
              Container(
                color: Colors.yellow,
                margin: const EdgeInsets.all(8),
                // height: 200,
                // width: 400,
                child: ListView.builder(
                    physics: NeverScrollableScrollPhysics(),
                    // scrollDirection: Axis.horizontal,
                    shrinkWrap: true,
                    itemCount: 3,
                    itemBuilder: (BuildContext ccontext, int index) {
                      return Padding(
                        padding: const EdgeInsets.fromLTRB(15, 8, 15, 8),
                        child: Row(
                          crossAxisAlignment: CrossAxisAlignment.center,
                          children: [
                            DecoratedBox(
                              child: Image.network(
                                'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fattach.bbs.miui.com%2Fforum%2F201403%2F02%2F092241w9f4vaz8peovfe91.jpg&refer=http%3A%2F%2Fattach.bbs.miui.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1617171292&t=b841f99b45f0beae202712d143ff6101',
                                width: 60,
                                height: 60,
                                // fit: BoxFit.fill,
                              ),
                              decoration: BoxDecoration(
                                border: Border.all(
                                    color: Color(0xFF999999), width: 0.5),
                                borderRadius: BorderRadius.circular((6.0)),
                                // borderRadius:
                                //     BorderRadius.vertical(top: Radius.elliptical(20, 50)),
                              ),
                            ),
                            const SizedBox(width: 10),
                            Expanded(
                              child: Column(
                                crossAxisAlignment: CrossAxisAlignment.start,
                                children: [
                                  Row(children: [
                                    Expanded(
                                      child: Row(
                                        children: [
                                          Flexible(
                                            child: Text(
                                              '园林股份' * 10,
                                              maxLines: 1,
                                              overflow: TextOverflow.ellipsis,
                                              style: Theme.of(context)
                                                  .textTheme
                                                  .subtitle1,
                                            ),
                                          ),
                                          Container(
                                            margin: const EdgeInsets.fromLTRB(
                                                5, 1, 10, 1),
                                            padding: const EdgeInsets.fromLTRB(
                                                2, 1, 2, 1),
                                            child: Text('传统行业'),
                                            decoration: BoxDecoration(
                                              color: Color(0xffebebeb),

                                              borderRadius:
                                                  BorderRadius.circular((6.0)),
                                              // borderRadius:
                                              //     BorderRadius.vertical(top: Radius.elliptical(20, 50)),
                                            ),
                                          ),
                                        ],
                                      ),
                                    ),
                                    Text('03-03')
                                  ]),
                                  Padding(
                                    padding: const EdgeInsets.only(
                                        top: 8.0, bottom: 8.0),
                                    child: Text('园林绿化综合性企业' * 3,
                                        style: TextStyle(
                                            fontSize: 14,
                                            color: Color(0xff666666))),
                                  ),
                                  Text('IPO,金融未披露,投资方未披露' * 3,
                                      style:
                                          Theme.of(context).textTheme.subtitle2)
                                ],
                              ),
                            )
                          ],
                        ),
                      );
                    }),
              ),
            ],
          )),
        ));
  }
}
